package com.ebupt.migu.music.system.mapper;

import com.ebupt.migu.music.common.tree.TreeNode;
import com.ebupt.migu.music.system.entity.SysRole;
import com.ebupt.migu.music.system.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface RoleMapper {

    List<SysRole> queryByPage(Map<String, Object> paramMap);

    Integer queryCount(Map<String, Object> paramMap);

    Integer addRole(Map<String, Object> paramMap);

    Integer addRolePriv(Map<String, Object> paramMap);

    Integer modifyRole(Map<String, Object> paramMap);

    Integer delRole(Map<String, Object> paramMap);

    Integer delRolePriv(Map<String, Object> paramMap);

    List<Map<String, Object>> getRolePriv(Map<String, Object> paramMap);

    List<TreeNode> getRolePrivList(Map<String, Object> paramMap);

    List<SysUser> queryRoleUserById(Integer roleId);

    /**
     * 查询用户角色
     *
     * @param userId
     * @return
     */
    List<String> queryRoleIdByUserId(String userId);
}
